﻿/// <reference path="Turbo_common.js" />

TA.Turbo.Common._LoadCookies = function _LoadCookies()
{
	for (var uniqueCookie in TA.Turbo.Common.UniqueCookies)
	{
		TA.Turbo.Common.UniqueCookies[uniqueCookie] = Cookies.Get(uniqueCookie);
		Cookies.Erase(uniqueCookie);
	}
}
TA.Turbo.Common._SaveCookies = function _SaveCookies()
{
	for (var uniqueCookie in TA.Turbo.Common.UniqueCookies)
	{
		Cookies.Add(uniqueCookie, TA.Turbo.Common.UniqueCookies[uniqueCookie], 1);
	}
}
TA.Turbo.Common._window_Unload = function _window_Unload()
{
	TA.Turbo.Common._SaveCookies();
}
TA.Turbo.Common.InitCookies = function InitCookies(cookies)
{
	TA.Turbo.Common.UniqueCookies = cookies;
	TA.Turbo.Common._LoadCookies();
	window.AddEvent("beforeunload", TA.Turbo.Common._window_Unload);
}